﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Transformer.iHunter.Plugins.ThuOnlineLearning
{
    class ThuLearningChannelProvider : IChannelProvider
    {
        #region IChannelProvider Members

        public IChannel CreateChannelInstance(ChannelInfo info)
        {
            IChannel channel = null;
            try
            {
                channel = new ThuLearningChannel(info.Settings);
            }
            catch
            {
                return null;
            }
            return channel;

        }

        public System.Windows.Forms.UserControl GetChannelConfigureEditor()
        {
            return new ThuLearningConfigDialog();
        }

        public System.Windows.Forms.UserControl[] GetNewChannelWizardPages()
        {
            return new System.Windows.Forms.UserControl[1] { new ThuLearningConfigDialog() };
        }

        #endregion

        #region IPlugin Members

        public Guid Guid
        {
            get 
            {
                return new Guid("3B07E46D-484C-42e7-922C-E5101D0FD621");
            }
        }

        public void Initialize(IPluginClient client)
        {
            //do nothing
        }

        public System.Windows.Forms.UserControl GetPluginConfigureEditor()
        {
            return null;
        }

        public event PluginErrorEventHandler ErrorOccur;

        #endregion

        #region IDisposable Members

        public void Dispose()
        {
            //do nothing
        }

        #endregion

        #region IPlugin 成员


        public string Name
        {
            get 
            { 
                return "THU Online Learning"; 
            }
        }

        public string Description
        {
            get 
            { 
                return "A plugin for accessing information on THU Online Learning Website."; 
            }
        }

        #endregion
       
        public Guid NewMesssageEditorGuid
        {
            get 
            {
                return new Guid("3B07E46D-484C-42e7-922C-E5101D0FD622");
                //return ThuLearningDiscussionEditorProvider.Guid;
            }
        }
    }
}
